<template>
  <div class="userindex">
    <!-- 用户背景图片 -->
    <div class="userBgc">
      <img src="	http://liufusong.top:8080/img/avatar.png" alt="" />
    </div>
    <!-- 用户状态框 -->
    <div class="userBox">
      <!-- 用户头像 -->
      <div class="userImg">
        <img src="http://liufusong.top:8080/img/profile/avatar.png" alt="" />
      </div>
      <!-- 用户名称 -->
      <div class="userNmame">
        <span>小陈</span>
      </div>
      <!-- 退出按钮 -->
      <div class="outlogin" @click="outLogin">退出</div>
      <!-- 编辑个人资料 -->
      <div class="changeUserInfo">
        <span>编辑个人资料</span>
      </div>
    </div>
    <!-- 用户页导航 -->
    <div class="nav">
      <van-grid :column-num="3" :border="false">
        <van-grid-item icon="star-o" text="我的收藏" to="/shoucang" />
        <van-grid-item icon="wap-home-o" text="我的出租" to="/chuzu" />
        <van-grid-item icon="underway-o" text="看房记录" />
        <van-grid-item icon="balance-o" text="成为房主" />
        <van-grid-item icon="user-o" text="个人资料" />
        <van-grid-item icon="phone-o" text="联系我们" />
      </van-grid>
      <!-- 底部广告 -->
      <div class="poster">
        <img src="http://liufusong.top:8080/img/profile/join.png" alt="" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "VueHkzfMy",

  data() {
    return {};
  },

  mounted() {},

  methods: {
    outLogin() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    },
  },
};
</script>

<style lang="less" scoped>
.userindex {
  padding-bottom: 60px;
}
.poster {
  width: 345px;
  height: 84.88px;
  margin: 0 auto;
  img {
    width: 100%;
  }
}
.nav {
  margin-top: 20px;
}
.userBgc {
  width: 100%;
  height: 375px;
  img {
    width: 100%;
  }
}
.userBox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  left: 50%;
  top: 25%;
  transform: translateX(-50%);
  width: 318.75px;
  height: 207.95px;
  background-color: #fff;
  box-shadow: 0 0 10px 3px #ddd;
  .userNmame {
    font-size: 15px;
  }
  .outlogin {
    width: 54px;
    height: 20.5px;
    background-color: #58b67f;
    color: white;
    line-height: 20.5px;
    text-align: center;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 20px;
  }
  .userImg {
    position: absolute;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-color: pink;
    border-radius: 50%;
    border: 5px solid #f5f5f5;
    img {
      width: 100%;
    }
  }
  .changeUserInfo {
    color: #999;
    font-size: 12px;
  }
}
</style>
